package org.geektimes.serialize.impl;

import java.nio.charset.StandardCharsets;

/**
 * @author karidyang
 */
public class StringSerializer extends AbstractSerializer<String> {


    @Override
    public byte[] doSerialize(String s) {
        return s.getBytes(StandardCharsets.UTF_8);
    }

    @Override
    public String doDescrialize(byte[] bytes, Class<String> typeClass) {
        return new String(bytes, StandardCharsets.UTF_8);
    }

}
